import request from '@/libs/request'

const baseResourceApi = '/admin/resource/'

export const getMenu = () => {
  return request({
    url: baseResourceApi + 'slideMenu',
    method: 'get'
  })
}

export const getTreeGrid = () => {
  return request({
    url: baseResourceApi + 'treeGrid'
  })
}

export const getPMenus = () => {
  return request({
    url: baseResourceApi + 'allTree'
  })
}

export const add = (params) => {
  return request({
    url: baseResourceApi + 'add',
    method: 'put',
    params
  })
}

export const edit = (data) => {
  return request({
    url: baseResourceApi + 'edit',
    method: 'post',
    data
  })
}

export const del = params => {
  return request({
    url: baseResourceApi + 'delete',
    method: 'delete',
    params
  })
}

export const allTrees = () => {
  return request({
    url: baseResourceApi + 'allTrees',
    method: 'get'
  })
}
